/*
 * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License version 2 only, as
 * published by the Free Software Foundation.
 *
 * This code is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * version 2 for more details (a copy is included in the LICENSE file that
 * accompanied this code).
 *
 * You should have received a copy of the GNU General Public License version
 * 2 along with this work; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 * or visit www.oracle.com if you need additional information or have any
 * questions.
 */
package com.oracle.truffle.r.nodes.builtin.base;

import com.oracle.truffle.api.frame.MaterializedFrame;
import com.oracle.truffle.r.nodes.RRootNode;
import com.oracle.truffle.r.nodes.access.variables.ReadVariableNode;
import com.oracle.truffle.r.nodes.binary.BinaryArithmeticNodeGen;
import com.oracle.truffle.r.nodes.binary.BinaryBooleanNodeGen;
import com.oracle.truffle.r.nodes.binary.BinaryBooleanScalarNodeGen;
import com.oracle.truffle.r.nodes.binary.ColonNode;
import com.oracle.truffle.r.nodes.binary.ColonNodeGen;
import com.oracle.truffle.r.nodes.builtin.RBuiltinPackage;
import com.oracle.truffle.r.nodes.builtin.base.fastpaths.AssignFastPathNodeGen;
import com.oracle.truffle.r.nodes.builtin.base.fastpaths.ExistsFastPathNodeGen;
import com.oracle.truffle.r.nodes.builtin.base.fastpaths.GetFastPathNodeGen;
import com.oracle.truffle.r.nodes.builtin.base.fastpaths.IntersectFastPathNodeGen;
import com.oracle.truffle.r.nodes.builtin.base.fastpaths.IsElementFastPathNodeGen;
import com.oracle.truffle.r.nodes.builtin.base.fastpaths.MatrixFastPathNodeGen;
import com.oracle.truffle.r.nodes.builtin.base.fastpaths.SetDiffFastPathNodeGen;
import com.oracle.truffle.r.nodes.builtin.base.fastpaths.VectorFastPathsFactory.DoubleFastPathNodeGen;
import com.oracle.truffle.r.nodes.builtin.base.fastpaths.VectorFastPathsFactory.IntegerFastPathNodeGen;
import com.oracle.truffle.r.nodes.builtin.base.foreign.DotC;
import com.oracle.truffle.r.nodes.builtin.base.foreign.DotCNodeGen;
import com.oracle.truffle.r.nodes.builtin.base.foreign.ForeignFunctions;
import com.oracle.truffle.r.nodes.builtin.base.foreign.ForeignFunctionsFactory;
import com.oracle.truffle.r.nodes.builtin.fastr.FastRContext;
import com.oracle.truffle.r.nodes.builtin.fastr.FastRContextFactory;
import com.oracle.truffle.r.nodes.builtin.fastr.FastRDebug;
import com.oracle.truffle.r.nodes.builtin.fastr.FastRDebugNodeGen;
import com.oracle.truffle.r.nodes.builtin.fastr.FastRFunctionProfiler;
import com.oracle.truffle.r.nodes.builtin.fastr.FastRFunctionProfilerFactory;
import com.oracle.truffle.r.nodes.builtin.fastr.FastRIdentity;
import com.oracle.truffle.r.nodes.builtin.fastr.FastRIdentityNodeGen;
import com.oracle.truffle.r.nodes.builtin.fastr.FastRInspect;
import com.oracle.truffle.r.nodes.builtin.fastr.FastRInspectNodeGen;
import com.oracle.truffle.r.nodes.builtin.fastr.FastRInterop;
import com.oracle.truffle.r.nodes.builtin.fastr.FastRInteropFactory;
import com.oracle.truffle.r.nodes.builtin.fastr.FastRRefCountInfo;
import com.oracle.truffle.r.nodes.builtin.fastr.FastRRefCountInfoNodeGen;
import com.oracle.truffle.r.nodes.builtin.fastr.FastRStackTrace;
import com.oracle.truffle.r.nodes.builtin.fastr.FastRStackTraceNodeGen;
import com.oracle.truffle.r.nodes.builtin.fastr.FastRSyntaxTree;
import com.oracle.truffle.r.nodes.builtin.fastr.FastRSyntaxTreeNodeGen;
import com.oracle.truffle.r.nodes.builtin.fastr.FastRThrowIt;
import com.oracle.truffle.r.nodes.builtin.fastr.FastRThrowItNodeGen;
import com.oracle.truffle.r.nodes.builtin.fastr.FastRTrace;
import com.oracle.truffle.r.nodes.builtin.fastr.FastRTraceFactory;
import com.oracle.truffle.r.nodes.builtin.fastr.FastRTree;
import com.oracle.truffle.r.nodes.builtin.fastr.FastRTreeNodeGen;
import com.oracle.truffle.r.nodes.builtin.fastr.FastRTreeStats;
import com.oracle.truffle.r.nodes.builtin.fastr.FastRTreeStatsNodeGen;
import com.oracle.truffle.r.nodes.builtin.fastr.FastrDqrls;
import com.oracle.truffle.r.nodes.builtin.fastr.FastrDqrlsNodeGen;
import com.oracle.truffle.r.nodes.unary.UnaryNotNode;
import com.oracle.truffle.r.nodes.unary.UnaryNotNodeGen;
import com.oracle.truffle.r.runtime.builtins.FastPathFactory;
import com.oracle.truffle.r.runtime.builtins.RBuiltin;
import com.oracle.truffle.r.runtime.data.RFunction;
import com.oracle.truffle.r.runtime.nodes.RFastPathNode;
import com.oracle.truffle.r.runtime.ops.BinaryArithmetic;
import com.oracle.truffle.r.runtime.ops.BinaryCompare;
import com.oracle.truffle.r.runtime.ops.BinaryLogic;
import com.oracle.truffle.r.runtime.ops.UnaryArithmetic;

public class BasePackage extends RBuiltinPackage {

    public BasePackage() {
        super("base");

        /*
         * Primitive operations (these are really builtins, but not currently defined that way, so
         * we fake it). N.B. UnaryNotNode is annotated, but not loaded automatically because it is
         * not in the {nodes.builtin.base} package, (along with all the other nodes). A corollary of
         * this is that all the node classes referenced here must be annotated with
         */
        add(UnaryNotNode.class, UnaryNotNodeGen::create);

        add(BinaryArithmetic.AddBuiltin.class, arguments -> BinaryArithmeticNodeGen.create(BinaryArithmetic.ADD, UnaryArithmetic.PLUS, arguments));
        add(BinaryArithmetic.SubtractBuiltin.class,
                        arguments -> BinaryArithmeticNodeGen.create(BinaryArithmetic.SUBTRACT, UnaryArithmetic.NEGATE, arguments));
        add(BinaryArithmetic.DivBuiltin.class, arguments -> BinaryArithmeticNodeGen.create(BinaryArithmetic.DIV, null, arguments));
        add(BinaryArithmetic.IntegerDivBuiltin.class, arguments -> BinaryArithmeticNodeGen.create(BinaryArithmetic.INTEGER_DIV, null, arguments));
        add(BinaryArithmetic.ModBuiltin.class, arguments -> BinaryArithmeticNodeGen.create(BinaryArithmetic.MOD, null, arguments));
        add(BinaryArithmetic.MultiplyBuiltin.class, arguments -> BinaryArithmeticNodeGen.create(BinaryArithmetic.MULTIPLY, null, arguments));
        add(BinaryArithmetic.PowBuiltin.class, arguments -> BinaryArithmeticNodeGen.create(BinaryArithmetic.POW, null, arguments));

        add(BinaryCompare.EqualBuiltin.class, arguments -> BinaryBooleanNodeGen.create(BinaryCompare.EQUAL, arguments));
        add(BinaryCompare.NotEqualBuiltin.class, arguments -> BinaryBooleanNodeGen.create(BinaryCompare.NOT_EQUAL, arguments));
        add(BinaryCompare.GreaterEqualBuiltin.class, arguments -> BinaryBooleanNodeGen.create(BinaryCompare.GREATER_EQUAL, arguments));
        add(BinaryCompare.GreaterBuiltin.class, arguments -> BinaryBooleanNodeGen.create(BinaryCompare.GREATER_THAN, arguments));
        add(BinaryCompare.LessBuiltin.class, arguments -> BinaryBooleanNodeGen.create(BinaryCompare.LESS_THAN, arguments));
        add(BinaryCompare.LessEqualBuiltin.class, arguments -> BinaryBooleanNodeGen.create(BinaryCompare.LESS_EQUAL, arguments));

        add(BinaryLogic.AndBuiltin.class, arguments -> BinaryBooleanNodeGen.create(BinaryLogic.AND, arguments));
        add(BinaryLogic.OrBuiltin.class, arguments -> BinaryBooleanNodeGen.create(BinaryLogic.OR, arguments));

        add(BinaryLogic.NonVectorAndBuiltin.class, arguments -> BinaryBooleanScalarNodeGen.create(BinaryLogic.NON_VECTOR_AND, arguments));
        add(BinaryLogic.NonVectorOrBuiltin.class, arguments -> BinaryBooleanScalarNodeGen.create(BinaryLogic.NON_VECTOR_OR, arguments));

        // Now load the rest of the builtins in "base"
        add(APerm.class, APermNodeGen::create);
        add(NumericalFunctions.Abs.class, NumericalFunctionsFactory.AbsNodeGen::create);
        add(All.class, AllNodeGen::create);
        add(AllNames.class, AllNamesNodeGen::create);
        add(Any.class, AnyNodeGen::create);
        add(AnyNA.class, AnyNANodeGen::create);
        add(Arg.class, ArgNodeGen::create);
        add(Args.class, ArgsNodeGen::create);
        add(Array.class, ArrayNodeGen::create);
        add(AsCall.class, AsCallNodeGen::create);
        add(AsCharacter.class, AsCharacterNodeGen::create);
        add(AsComplex.class, AsComplexNodeGen::create);
        add(AsDouble.class, AsDoubleNodeGen::create);
        add(AsFunction.class, AsFunctionNodeGen::create);
        add(AsInteger.class, AsIntegerNodeGen::create);
        add(AsLogical.class, AsLogicalNodeGen::create);
        add(SetS4Object.class, SetS4ObjectNodeGen::create);
        add(SetTimeLimit.class, SetTimeLimitNodeGen::create);
        add(AsRaw.class, AsRawNodeGen::create);
        add(AsVector.class, AsVectorNodeGen::create);
        add(Assign.class, AssignNodeGen::create);
        add(AttachFunctions.Attach.class, AttachFunctionsFactory.AttachNodeGen::create);
        add(AttachFunctions.Detach.class, AttachFunctionsFactory.DetachNodeGen::create);
        add(Attr.class, AttrNodeGen::create);
        add(Attributes.class, AttributesNodeGen::create);
        add(BaseGammaFunctions.DiGamma.class, BaseGammaFunctionsFactory.DiGammaNodeGen::create);
        add(BaseGammaFunctions.Gamma.class, BaseGammaFunctionsFactory.GammaNodeGen::create);
        add(BaseGammaFunctions.Lgamma.class, BaseGammaFunctionsFactory.LgammaNodeGen::create);
        add(BaseGammaFunctions.TriGamma.class, BaseGammaFunctionsFactory.TriGammaNodeGen::create);
        add(Choose.class, ChooseNodeGen::create);
        add(Bincode.class, BincodeNodeGen::create);
        add(Bind.CbindInternal.class, BindNodeGen.CbindInternalNodeGen::create);
        add(Bind.RbindInternal.class, BindNodeGen.RbindInternalNodeGen::create);
        add(BitwiseFunctions.BitwiseAnd.class, BitwiseFunctionsFactory.BitwiseAndNodeGen::create);
        add(BitwiseFunctions.BitwiseNot.class, BitwiseFunctionsFactory.BitwiseNotNodeGen::create);
        add(BitwiseFunctions.BitwiseOr.class, BitwiseFunctionsFactory.BitwiseOrNodeGen::create);
        add(BitwiseFunctions.BitwiseShiftL.class, BitwiseFunctionsFactory.BitwiseShiftLNodeGen::create);
        add(BitwiseFunctions.BitwiseShiftR.class, BitwiseFunctionsFactory.BitwiseShiftRNodeGen::create);
        add(BitwiseFunctions.BitwiseXor.class, BitwiseFunctionsFactory.BitwiseXorNodeGen::create);
        add(Body.class, BodyNodeGen::create);
        add(BrowserFunctions.BrowserCondition.class, BrowserFunctionsFactory.BrowserConditionNodeGen::create);
        add(BrowserFunctions.BrowserNode.class, BrowserFunctionsFactory.BrowserNodeGen::create);
        add(BrowserFunctions.BrowserSetDebug.class, BrowserFunctionsFactory.BrowserSetDebugNodeGen::create);
        add(BrowserFunctions.BrowserText.class, BrowserFunctionsFactory.BrowserTextNodeGen::create);
        add(Call.class, CallNodeGen::create);
        add(CapabilitiesFunctions.Capabilities.class, CapabilitiesFunctionsFactory.CapabilitiesNodeGen::create);
        add(Cat.class, CatNodeGen::create);
        add(Ceiling.class, CeilingNodeGen::create);
        add(CharMatch.class, CharMatchNodeGen::create);
        add(Col.class, ColNodeGen::create);
        add(ColonNode.class, ColonNodeGen::create);
        add(ColMeans.class, ColMeansNodeGen::create);
        add(ColSums.class, ColSumsNodeGen::create);
        add(Combine.class, CombineNodeGen::create);
        add(CommandArgs.class, CommandArgsNodeGen::create);
        add(Complex.class, ComplexNodeGen::create);
        add(CompilePKGS.class, CompilePKGSNodeGen::create);
        add(NumericalFunctions.Conj.class, NumericalFunctionsFactory.ConjNodeGen::create);
        add(ConditionFunctions.AddCondHands.class, ConditionFunctionsFactory.AddCondHandsNodeGen::create);
        add(ConditionFunctions.AddRestart.class, ConditionFunctionsFactory.AddRestartNodeGen::create);
        add(ConditionFunctions.DfltStop.class, ConditionFunctionsFactory.DfltStopNodeGen::create);
        add(ConditionFunctions.DfltWarn.class, ConditionFunctionsFactory.DfltWarnNodeGen::create);
        add(ConditionFunctions.GetRestart.class, ConditionFunctionsFactory.GetRestartNodeGen::create);
        add(ConditionFunctions.Geterrmessage.class, ConditionFunctionsFactory.GeterrmessageNodeGen::create);
        add(ConditionFunctions.InvokeRestart.class, ConditionFunctionsFactory.InvokeRestartNodeGen::create);
        add(ConditionFunctions.PrintDeferredWarnings.class, ConditionFunctionsFactory.PrintDeferredWarningsNodeGen::create);
        add(ConditionFunctions.ResetCondHands.class, ConditionFunctionsFactory.ResetCondHandsNodeGen::create);
        add(ConditionFunctions.Seterrmessage.class, ConditionFunctionsFactory.SeterrmessageNodeGen::create);
        add(ConditionFunctions.SignalCondition.class, ConditionFunctionsFactory.SignalConditionNodeGen::create);
        add(ConnectionFunctions.Close.class, ConnectionFunctionsFactory.CloseNodeGen::create);
        add(ConnectionFunctions.File.class, ConnectionFunctionsFactory.FileNodeGen::create);
        add(ConnectionFunctions.Flush.class, ConnectionFunctionsFactory.FlushNodeGen::create);
        add(ConnectionFunctions.GZFile.class, ConnectionFunctionsFactory.GZFileNodeGen::create);
        add(ConnectionFunctions.GetAllConnections.class, ConnectionFunctionsFactory.GetAllConnectionsNodeGen::create);
        add(ConnectionFunctions.GetConnection.class, ConnectionFunctionsFactory.GetConnectionNodeGen::create);
        add(ConnectionFunctions.IsOpen.class, ConnectionFunctionsFactory.IsOpenNodeGen::create);
        add(ConnectionFunctions.IsSeekable.class, ConnectionFunctionsFactory.IsSeekableNodeGen::create);
        add(ConnectionFunctions.Open.class, ConnectionFunctionsFactory.OpenNodeGen::create);
        add(ConnectionFunctions.PushBack.class, ConnectionFunctionsFactory.PushBackNodeGen::create);
        add(ConnectionFunctions.PushBackClear.class, ConnectionFunctionsFactory.PushBackClearNodeGen::create);
        add(ConnectionFunctions.PushBackLength.class, ConnectionFunctionsFactory.PushBackLengthNodeGen::create);
        add(ConnectionFunctions.ReadBin.class, ConnectionFunctionsFactory.ReadBinNodeGen::create);
        add(ConnectionFunctions.ReadChar.class, ConnectionFunctionsFactory.ReadCharNodeGen::create);
        add(ConnectionFunctions.ReadLines.class, ConnectionFunctionsFactory.ReadLinesNodeGen::create);
        add(ConnectionFunctions.Seek.class, ConnectionFunctionsFactory.SeekNodeGen::create);
        add(ConnectionFunctions.SocketConnection.class, ConnectionFunctionsFactory.SocketConnectionNodeGen::create);
        add(ConnectionFunctions.Stderr.class, ConnectionFunctionsFactory.StderrNodeGen::create);
        add(ConnectionFunctions.Stdin.class, ConnectionFunctionsFactory.StdinNodeGen::create);
        add(ConnectionFunctions.Stdout.class, ConnectionFunctionsFactory.StdoutNodeGen::create);
        add(ConnectionFunctions.Summary.class, ConnectionFunctionsFactory.SummaryNodeGen::create);
        add(ConnectionFunctions.TextConnection.class, ConnectionFunctionsFactory.TextConnectionNodeGen::create);
        add(ConnectionFunctions.TextConnectionValue.class, ConnectionFunctionsFactory.TextConnectionValueNodeGen::create);
        add(ConnectionFunctions.URLConnection.class, ConnectionFunctionsFactory.URLConnectionNodeGen::create);
        add(ConnectionFunctions.WriteBin.class, ConnectionFunctionsFactory.WriteBinNodeGen::create);
        add(ConnectionFunctions.WriteChar.class, ConnectionFunctionsFactory.WriteCharNodeGen::create);
        add(ConnectionFunctions.WriteLines.class, ConnectionFunctionsFactory.WriteLinesNodeGen::create);
        add(Contributors.class, ContributorsNodeGen::create);
        add(CopyDFAttr.class, CopyDFAttrNodeGen::create);
        add(Crossprod.class, CrossprodNodeGen::create);
        add(CumMax.class, CumMaxNodeGen::create);
        add(CumMin.class, CumMinNodeGen::create);
        add(CumProd.class, CumProdNodeGen::create);
        add(CumSum.class, CumSumNodeGen::create);
        add(CacheClass.class, CacheClassNodeGen::create);
        add(Date.class, DateNodeGen::create);
        add(DatePOSIXFunctions.Date2POSIXlt.class, DatePOSIXFunctionsFactory.Date2POSIXltNodeGen::create);
        add(DatePOSIXFunctions.AsPOSIXct.class, DatePOSIXFunctionsFactory.AsPOSIXctNodeGen::create);
        add(DatePOSIXFunctions.AsPOSIXlt.class, DatePOSIXFunctionsFactory.AsPOSIXltNodeGen::create);
        add(DatePOSIXFunctions.FormatPOSIXlt.class, DatePOSIXFunctionsFactory.FormatPOSIXltNodeGen::create);
        add(DatePOSIXFunctions.POSIXlt2Date.class, DatePOSIXFunctionsFactory.POSIXlt2DateNodeGen::create);
        add(DatePOSIXFunctions.StrPTime.class, DatePOSIXFunctionsFactory.StrPTimeNodeGen::create);
        add(DebugFunctions.Debug.class, DebugFunctionsFactory.DebugNodeGen::create);
        add(DebugFunctions.DebugOnce.class, DebugFunctionsFactory.DebugOnceNodeGen::create);
        add(DebugFunctions.IsDebugged.class, DebugFunctionsFactory.IsDebuggedNodeGen::create);
        add(DebugFunctions.UnDebug.class, DebugFunctionsFactory.UnDebugNodeGen::create);
        add(DelayedAssign.class, DelayedAssignNodeGen::create);
        add(Deparse.class, DeparseNodeGen::create);
        add(Diag.class, DiagNodeGen::create);
        add(Dim.class, DimNodeGen::create);
        add(DimNames.class, DimNamesNodeGen::create);
        add(DoCall.class, DoCallNodeGen::create);
        add(DPut.class, DPutNodeGen::create);
        add(Drop.class, DropNodeGen::create);
        add(DuplicatedFunctions.AnyDuplicated.class, DuplicatedFunctionsFactory.AnyDuplicatedNodeGen::create);
        add(DuplicatedFunctions.Duplicated.class, DuplicatedFunctionsFactory.DuplicatedNodeGen::create);
        add(DynLoadFunctions.DynLoad.class, DynLoadFunctionsFactory.DynLoadNodeGen::create);
        add(DynLoadFunctions.DynUnload.class, DynLoadFunctionsFactory.DynUnloadNodeGen::create);
        add(DynLoadFunctions.GetLoadedDLLs.class, DynLoadFunctionsFactory.GetLoadedDLLsNodeGen::create);
        add(DynLoadFunctions.GetSymbolInfo.class, DynLoadFunctionsFactory.GetSymbolInfoNodeGen::create);
        add(DynLoadFunctions.IsLoaded.class, DynLoadFunctionsFactory.IsLoadedNodeGen::create);
        add(EncodeString.class, EncodeStringNodeGen::create);
        add(EncodingFunctions.Encoding.class, EncodingFunctionsFactory.EncodingNodeGen::create);
        add(EncodingFunctions.SetEncoding.class, EncodingFunctionsFactory.SetEncodingNodeGen::create);
        add(EnvFunctions.AsEnvironment.class, EnvFunctionsFactory.AsEnvironmentNodeGen::create);
        add(EnvFunctions.BaseEnv.class, EnvFunctionsFactory.BaseEnvNodeGen::create);
        add(EnvFunctions.BindingIsActive.class, EnvFunctionsFactory.BindingIsActiveNodeGen::create);
        add(EnvFunctions.BindingIsLocked.class, EnvFunctionsFactory.BindingIsLockedNodeGen::create);
        add(EnvFunctions.EmptyEnv.class, EnvFunctionsFactory.EmptyEnvNodeGen::create);
        add(EnvFunctions.EnvToList.class, EnvFunctionsFactory.EnvToListNodeGen::create);
        add(EnvFunctions.Environment.class, EnvFunctionsFactory.EnvironmentNodeGen::create);
        add(EnvFunctions.EnvironmentIsLocked.class, EnvFunctionsFactory.EnvironmentIsLockedNodeGen::create);
        add(EnvFunctions.EnvironmentName.class, EnvFunctionsFactory.EnvironmentNameNodeGen::create);
        add(EnvFunctions.GlobalEnv.class, EnvFunctionsFactory.GlobalEnvNodeGen::create);
        add(EnvFunctions.IsEnvironment.class, EnvFunctionsFactory.IsEnvironmentNodeGen::create);
        add(EnvFunctions.LockBinding.class, EnvFunctionsFactory.LockBindingNodeGen::create);
        add(EnvFunctions.LockEnvironment.class, EnvFunctionsFactory.LockEnvironmentNodeGen::create);
        add(EnvFunctions.MakeActiveBinding.class, EnvFunctionsFactory.MakeActiveBindingNodeGen::create);
        add(EnvFunctions.NewEnv.class, EnvFunctionsFactory.NewEnvNodeGen::create);
        add(EnvFunctions.ParentEnv.class, EnvFunctionsFactory.ParentEnvNodeGen::create);
        add(EnvFunctions.TopEnv.class, EnvFunctionsFactory.TopEnvNodeGen::create);
        add(EnvFunctions.Search.class, EnvFunctionsFactory.SearchNodeGen::create);
        add(EnvFunctions.SetParentEnv.class, EnvFunctionsFactory.SetParentEnvNodeGen::create);
        add(EnvFunctions.UnlockBinding.class, EnvFunctionsFactory.UnlockBindingNodeGen::create);
        add(EvalFunctions.Eval.class, EvalFunctionsFactory.EvalNodeGen::create);
        add(WithVisible.class, WithVisibleNodeGen::create);
        add(Exists.class, ExistsNodeGen::create);
        add(Expression.class, ExpressionNodeGen::create);
        add(FastRContext.CloseChannel.class, FastRContextFactory.CloseChannelNodeGen::create);
        add(FastRContext.CreateChannel.class, FastRContextFactory.CreateChannelNodeGen::create);
        add(FastRContext.Eval.class, FastRContextFactory.EvalNodeGen::create);
        add(FastRContext.Get.class, FastRContextFactory.GetNodeGen::create);
        add(FastRContext.GetChannel.class, FastRContextFactory.GetChannelNodeGen::create);
        add(FastRContext.ChannelPoll.class, FastRContextFactory.ChannelPollNodeGen::create);
        add(FastRContext.ChannelReceive.class, FastRContextFactory.ChannelReceiveNodeGen::create);
        add(FastRContext.ChannelSelect.class, FastRContextFactory.ChannelSelectNodeGen::create);
        add(FastRContext.ChannelSend.class, FastRContextFactory.ChannelSendNodeGen::create);
        add(FastRContext.Spawn.class, FastRContextFactory.SpawnNodeGen::create);
        add(FastRContext.Join.class, FastRContextFactory.JoinNodeGen::create);
        add(FastrDqrls.class, FastrDqrlsNodeGen::create);
        add(FastRDebug.class, FastRDebugNodeGen::create);
        add(FastRFunctionProfiler.Create.class, FastRFunctionProfilerFactory.CreateNodeGen::create);
        add(FastRFunctionProfiler.Get.class, FastRFunctionProfilerFactory.GetNodeGen::create);
        add(FastRFunctionProfiler.Reset.class, FastRFunctionProfilerFactory.ResetNodeGen::create);
        add(FastRFunctionProfiler.Clear.class, FastRFunctionProfilerFactory.ClearNodeGen::create);
        add(FastRIdentity.class, FastRIdentityNodeGen::create);
        add(FastRInspect.class, FastRInspectNodeGen::create);
        add(FastRInterop.Eval.class, FastRInteropFactory.EvalNodeGen::create);
        add(FastRInterop.Export.class, FastRInteropFactory.ExportNodeGen::create);
        add(FastRInterop.Import.class, FastRInteropFactory.ImportNodeGen::create);
        add(FastRRefCountInfo.class, FastRRefCountInfoNodeGen::create);
        add(FastRStackTrace.class, FastRStackTraceNodeGen::create);
        add(FastRSyntaxTree.class, FastRSyntaxTreeNodeGen::create);
        add(FastRThrowIt.class, FastRThrowItNodeGen::create);
        add(FastRTrace.Trace.class, FastRTraceFactory.TraceNodeGen::create);
        add(FastRTrace.Untrace.class, FastRTraceFactory.UntraceNodeGen::create);
        add(FastRTree.class, FastRTreeNodeGen::create);
        add(FastRTreeStats.class, FastRTreeStatsNodeGen::create);
        add(FileFunctions.BaseName.class, FileFunctionsFactory.BaseNameNodeGen::create);
        add(FileFunctions.DirCreate.class, FileFunctionsFactory.DirCreateNodeGen::create);
        add(FileFunctions.DirExists.class, FileFunctionsFactory.DirExistsNodeGen::create);
        add(FileFunctions.DirName.class, FileFunctionsFactory.DirNameNodeGen::create);
        add(FileFunctions.FileAccess.class, FileFunctionsFactory.FileAccessNodeGen::create);
        add(FileFunctions.FileAppend.class, FileFunctionsFactory.FileAppendNodeGen::create);
        add(FileFunctions.FileCopy.class, FileFunctionsFactory.FileCopyNodeGen::create);
        add(FileFunctions.FileCreate.class, FileFunctionsFactory.FileCreateNodeGen::create);
        add(FileFunctions.FileExists.class, FileFunctionsFactory.FileExistsNodeGen::create);
        add(FileFunctions.FileInfo.class, FileFunctionsFactory.FileInfoNodeGen::create);
        add(FileFunctions.FileLink.class, FileFunctionsFactory.FileLinkNodeGen::create);
        add(FileFunctions.FilePath.class, FileFunctionsFactory.FilePathNodeGen::create);
        add(FileFunctions.FileRemove.class, FileFunctionsFactory.FileRemoveNodeGen::create);
        add(FileFunctions.FileRename.class, FileFunctionsFactory.FileRenameNodeGen::create);
        add(FileFunctions.FileSymLink.class, FileFunctionsFactory.FileSymLinkNodeGen::create);
        add(FileFunctions.ListFiles.class, FileFunctionsFactory.ListFilesNodeGen::create);
        add(FileFunctions.ListDirs.class, FileFunctionsFactory.ListDirsNodeGen::create);
        add(FileFunctions.Unlink.class, FileFunctionsFactory.UnlinkNodeGen::create);
        add(Floor.class, FloorNodeGen::create);
        add(DotC.class, DotCNodeGen::create);
        add(ForceAndCall.class, ForceAndCallNodeGen::create);
        add(ForeignFunctions.DotCall.class, ForeignFunctionsFactory.DotCallNodeGen::create);
        add(ForeignFunctions.DotCallGraphics.class, ForeignFunctionsFactory.DotCallGraphicsNodeGen::create);
        add(ForeignFunctions.DotExternal.class, ForeignFunctionsFactory.DotExternalNodeGen::create);
        add(ForeignFunctions.DotExternal2.class, ForeignFunctionsFactory.DotExternal2NodeGen::create);
        add(ForeignFunctions.DotExternalGraphics.class, ForeignFunctionsFactory.DotExternalGraphicsNodeGen::create);
        add(ForeignFunctions.Fortran.class, ForeignFunctionsFactory.FortranNodeGen::create);
        add(Formals.class, FormalsNodeGen::create);
        add(Format.class, FormatNodeGen::create);
        add(FormatC.class, FormatCNodeGen::create);
        add(FrameFunctions.MatchCall.class, FrameFunctionsFactory.MatchCallNodeGen::create);
        add(FrameFunctions.ParentFrame.class, FrameFunctionsFactory.ParentFrameNodeGen::create);
        add(FrameFunctions.SysCall.class, FrameFunctionsFactory.SysCallNodeGen::create);
        add(FrameFunctions.SysCalls.class, FrameFunctionsFactory.SysCallsNodeGen::create);
        add(FrameFunctions.SysFrame.class, FrameFunctionsFactory.SysFrameNodeGen::create);
        add(FrameFunctions.SysFrames.class, FrameFunctionsFactory.SysFramesNodeGen::create);
        add(FrameFunctions.SysFunction.class, FrameFunctionsFactory.SysFunctionNodeGen::create);
        add(FrameFunctions.SysNFrame.class, FrameFunctionsFactory.SysNFrameNodeGen::create);
        add(FrameFunctions.SysParent.class, FrameFunctionsFactory.SysParentNodeGen::create);
        add(FrameFunctions.SysParents.class, FrameFunctionsFactory.SysParentsNodeGen::create);
        add(Gc.class, GcNodeGen::create);
        add(GetClass.class, GetClassNodeGen::create);
        add(GetFunctions.Get.class, GetFunctionsFactory.GetNodeGen::create);
        add(GetFunctions.Get0.class, GetFunctionsFactory.Get0NodeGen::create);
        add(GetFunctions.MGet.class, GetFunctionsFactory.MGetNodeGen::create);
        add(GetOldClass.class, GetOldClassNodeGen::create);
        add(OptionsFunctions.GetOption.class, OptionsFunctionsFactory.GetOptionNodeGen::create);
        add(GetText.class, GetTextNodeGen::create);
        add(Getwd.class, GetwdNodeGen::create);
        add(GrepFunctions.AGrep.class, GrepFunctionsFactory.AGrepNodeGen::create);
        add(GrepFunctions.AGrepL.class, GrepFunctionsFactory.AGrepLNodeGen::create);
        add(GrepFunctions.GSub.class, GrepFunctionsFactory.GSubNodeGen::create);
        add(GrepFunctions.Gregexpr.class, GrepFunctionsFactory.GregexprNodeGen::create);
        add(GrepFunctions.Grep.class, GrepFunctionsFactory.GrepNodeGen::create);
        add(GrepFunctions.GrepL.class, GrepFunctionsFactory.GrepLNodeGen::create);
        add(GrepFunctions.Regexp.class, GrepFunctionsFactory.RegexpNodeGen::create);
        add(GrepFunctions.Strsplit.class, GrepFunctionsFactory.StrsplitNodeGen::create);
        add(GrepFunctions.Sub.class, GrepFunctionsFactory.SubNodeGen::create);
        add(HiddenInternalFunctions.GetRegisteredRoutines.class, HiddenInternalFunctionsFactory.GetRegisteredRoutinesNodeGen::create);
        add(HiddenInternalFunctions.ImportIntoEnv.class, HiddenInternalFunctionsFactory.ImportIntoEnvNodeGen::create);
        add(HiddenInternalFunctions.LazyLoadDBFetch.class, HiddenInternalFunctionsFactory.LazyLoadDBFetchNodeGen::create);
        add(HiddenInternalFunctions.LazyLoadDBFlush.class, HiddenInternalFunctionsFactory.LazyLoadDBFlushNodeGen::create);
        add(HiddenInternalFunctions.MakeLazy.class, HiddenInternalFunctionsFactory.MakeLazyNodeGen::create);
        add(HiddenInternalFunctions.GetVarsFromFrame.class, HiddenInternalFunctionsFactory.GetVarsFromFrameNodeGen::create);
        add(HiddenInternalFunctions.LazyLoadDBinsertValue.class, HiddenInternalFunctionsFactory.LazyLoadDBinsertValueNodeGen::create);
        add(IConv.class, IConvNodeGen::create);
        add(Identical.class, Identical::create);
        add(NumericalFunctions.Im.class, NumericalFunctionsFactory.ImNodeGen::create);
        add(InfixFunctions.AccessArraySubscriptBuiltin.class, InfixFunctionsFactory.AccessArraySubscriptBuiltinNodeGen::create);
        add(InfixFunctions.AccessArraySubscriptDefaultBuiltin.class, InfixFunctionsFactory.AccessArraySubscriptBuiltinNodeGen::create);
        add(InfixFunctions.AccessArraySubsetBuiltin.class, InfixFunctionsFactory.AccessArraySubsetBuiltinNodeGen::create);
        add(InfixFunctions.AccessArraySubsetDefaultBuiltin.class, InfixFunctionsFactory.AccessArraySubsetBuiltinNodeGen::create);
        add(InfixFunctions.AccessFieldBuiltin.class, InfixFunctionsFactory.AccessFieldBuiltinNodeGen::create);
        add(InfixFunctions.AssignBuiltin.class, InfixFunctionsFactory.AssignBuiltinNodeGen::create);
        add(InfixFunctions.AssignBuiltinEq.class, InfixFunctionsFactory.AssignBuiltinEqNodeGen::create);
        add(InfixFunctions.AssignOuterBuiltin.class, InfixFunctionsFactory.AssignOuterBuiltinNodeGen::create);
        add(InfixFunctions.BraceBuiltin.class, InfixFunctionsFactory.BraceBuiltinNodeGen::create);
        add(InfixFunctions.BreakBuiltin.class, InfixFunctionsFactory.BreakBuiltinNodeGen::create);
        add(InfixFunctions.ForBuiltin.class, InfixFunctionsFactory.ForBuiltinNodeGen::create);
        add(InfixFunctions.FunctionBuiltin.class, InfixFunctionsFactory.FunctionBuiltinNodeGen::create);
        add(InfixFunctions.IfBuiltin.class, InfixFunctionsFactory.IfBuiltinNodeGen::create);
        add(InfixFunctions.NextBuiltin.class, InfixFunctionsFactory.NextBuiltinNodeGen::create);
        add(InfixFunctions.ParenBuiltin.class, InfixFunctionsFactory.ParenBuiltinNodeGen::create);
        add(InfixFunctions.RepeatBuiltin.class, InfixFunctionsFactory.RepeatBuiltinNodeGen::create);
        add(InfixFunctions.TildeBuiltin.class, InfixFunctionsFactory.TildeBuiltinNodeGen::create);
        add(InfixFunctions.UpdateArrayNodeSubscriptBuiltin.class, InfixFunctionsFactory.UpdateArrayNodeSubscriptBuiltinNodeGen::create);
        add(InfixFunctions.UpdateArraySubsetBuiltin.class, InfixFunctionsFactory.UpdateArraySubsetBuiltinNodeGen::create);
        add(InfixFunctions.UpdateFieldBuiltin.class, InfixFunctionsFactory.UpdateFieldBuiltinNodeGen::create);
        add(InfixFunctions.WhileBuiltin.class, InfixFunctionsFactory.WhileBuiltinNodeGen::create);
        add(Inherits.class, InheritsNodeGen::create);
        add(Interactive.class, InteractiveNodeGen::create);
        add(Internal.class, InternalNodeGen::create);
        add(IntToBits.class, IntToBitsNodeGen::create);
        add(Invisible.class, InvisibleNodeGen::create);
        add(IsATTY.class, IsATTYNodeGen::create);
        add(IsFiniteFunctions.IsFinite.class, IsFiniteFunctionsFactory.IsFiniteNodeGen::create);
        add(IsFiniteFunctions.IsInfinite.class, IsFiniteFunctionsFactory.IsInfiniteNodeGen::create);
        add(IsFiniteFunctions.IsNaN.class, IsFiniteFunctionsFactory.IsNaNNodeGen::create);
        add(IsListFactor.class, IsListFactorNodeGen::create);
        add(IsMethodsDispatchOn.class, IsMethodsDispatchOnNodeGen::create);
        add(IsNA.class, IsNANodeGen::create);
        add(IsS4.class, IsS4NodeGen::create);
        add(IsTypeFunctions.IsArray.class, IsTypeFunctionsFactory.IsArrayNodeGen::create);
        add(IsTypeFunctions.IsAtomic.class, IsTypeFunctionsFactory.IsAtomicNodeGen::create);
        add(IsTypeFunctions.IsCall.class, IsTypeFunctionsFactory.IsCallNodeGen::create);
        add(IsTypeFunctions.IsCharacter.class, IsTypeFunctionsFactory.IsCharacterNodeGen::create);
        add(IsTypeFunctions.IsComplex.class, IsTypeFunctionsFactory.IsComplexNodeGen::create);
        add(IsTypeFunctions.IsDouble.class, IsTypeFunctionsFactory.IsDoubleNodeGen::create);
        add(IsTypeFunctions.IsExpression.class, IsTypeFunctionsFactory.IsExpressionNodeGen::create);
        add(IsTypeFunctions.IsFunction.class, IsTypeFunctionsFactory.IsFunctionNodeGen::create);
        add(IsTypeFunctions.IsInteger.class, IsTypeFunctionsFactory.IsIntegerNodeGen::create);
        add(IsTypeFunctions.IsLanguage.class, IsTypeFunctionsFactory.IsLanguageNodeGen::create);
        add(IsTypeFunctions.IsList.class, IsTypeFunctionsFactory.IsListNodeGen::create);
        add(IsTypeFunctions.IsLogical.class, IsTypeFunctionsFactory.IsLogicalNodeGen::create);
        add(IsTypeFunctions.IsMatrix.class, IsTypeFunctionsFactory.IsMatrixNodeGen::create);
        add(IsTypeFunctions.IsName.class, IsTypeFunctionsFactory.IsNameNodeGen::create);
        add(IsTypeFunctions.IsNull.class, IsTypeFunctionsFactory.IsNullNodeGen::create);
        add(IsTypeFunctions.IsNumeric.class, IsTypeFunctionsFactory.IsNumericNodeGen::create);
        add(IsTypeFunctions.IsObject.class, IsTypeFunctionsFactory.IsObjectNodeGen::create);
        add(IsTypeFunctions.IsPairList.class, IsTypeFunctionsFactory.IsPairListNodeGen::create);
        add(IsTypeFunctions.IsRaw.class, IsTypeFunctionsFactory.IsRawNodeGen::create);
        add(IsTypeFunctions.IsRecursive.class, IsTypeFunctionsFactory.IsRecursiveNodeGen::create);
        add(IsTypeFunctions.IsVector.class, IsTypeFunctionsFactory.IsVectorNodeGen::create);
        add(IsUnsorted.class, IsUnsortedNodeGen::create);
        add(LaFunctions.DetGeReal.class, LaFunctionsFactory.DetGeRealNodeGen::create);
        add(LaFunctions.LaChol.class, LaFunctionsFactory.LaCholNodeGen::create);
        add(LaFunctions.Qr.class, LaFunctionsFactory.QrNodeGen::create);
        add(LaFunctions.QrCoefReal.class, LaFunctionsFactory.QrCoefRealNodeGen::create);
        add(LaFunctions.Rg.class, LaFunctionsFactory.RgNodeGen::create);
        add(LaFunctions.Version.class, LaFunctionsFactory.VersionNodeGen::create);
        add(LaFunctions.LaSolve.class, LaFunctionsFactory.LaSolveNodeGen::create);
        add(Lapply.class, LapplyNodeGen::create);
        add(Length.class, LengthNodeGen::create);
        add(Lengths.class, LengthsNodeGen::create);
        add(License.class, LicenseNodeGen::create);
        add(ListBuiltin.class, ListBuiltinNodeGen::create);
        add(List2Env.class, List2EnvNodeGen::create);
        add(LoadSaveFunctions.Load.class, LoadSaveFunctionsFactory.LoadNodeGen::create);
        add(LoadSaveFunctions.LoadFromConn2.class, LoadSaveFunctionsFactory.LoadFromConn2NodeGen::create);
        add(LoadSaveFunctions.SaveToConn.class, LoadSaveFunctionsFactory.SaveToConnNodeGen::create);
        add(LocaleFunctions.BindTextDomain.class, LocaleFunctionsFactory.BindTextDomainNodeGen::create);
        add(LocaleFunctions.Enc2Native.class, LocaleFunctionsFactory.Enc2NativeNodeGen::create);
        add(LocaleFunctions.Enc2Utf8.class, LocaleFunctionsFactory.Enc2Utf8NodeGen::create);
        add(LocaleFunctions.GetLocale.class, LocaleFunctionsFactory.GetLocaleNodeGen::create);
        add(LocaleFunctions.L10nInfo.class, LocaleFunctionsFactory.L10nInfoNodeGen::create);
        add(LocaleFunctions.LocaleConv.class, LocaleFunctionsFactory.LocaleConvNodeGen::create);
        add(LocaleFunctions.SetLocale.class, LocaleFunctionsFactory.SetLocaleNodeGen::create);
        add(LogFunctions.Log.class, LogFunctionsFactory.LogNodeGen::create);
        add(LogFunctions.Log10.class, LogFunctionsFactory.Log10NodeGen::create);
        add(LogFunctions.Log1p.class, LogFunctionsFactory.Log1pNodeGen::create);
        add(LogFunctions.Log2.class, LogFunctionsFactory.Log2NodeGen::create);
        add(Ls.class, LsNodeGen::create);
        add(MakeNames.class, MakeNamesNodeGen::create);
        add(MakeUnique.class, MakeUniqueNodeGen::create);
        add(Mapply.class, MapplyNodeGen::create);
        add(MatMult.class, MatMultNodeGen::create);
        add(Match.class, MatchNodeGen::create);
        add(MatchFun.class, MatchFunNodeGen::create);
        add(Matrix.class, MatrixNodeGen::create);
        add(Max.class, MaxNodeGen::create);
        add(Mean.class, MeanNodeGen::create);
        add(Merge.class, MergeNodeGen::create);
        add(Min.class, MinNodeGen::create);
        add(Missing.class, Missing::create);
        add(NumericalFunctions.Mod.class, NumericalFunctionsFactory.ModNodeGen::create);
        add(NArgs.class, NArgsNodeGen::create);
        add(NChar.class, NCharNodeGen::create);
        add(NGetText.class, NGetTextNodeGen::create);
        add(NZChar.class, NZCharNodeGen::create);
        add(Names.class, NamesNodeGen::create);
        add(NamespaceFunctions.GetNamespaceRegistry.class, NamespaceFunctionsFactory.GetNamespaceRegistryNodeGen::create);
        add(NamespaceFunctions.GetRegisteredNamespace.class, NamespaceFunctionsFactory.GetRegisteredNamespaceNodeGen::create);
        add(NamespaceFunctions.IsNamespaceEnv.class, NamespaceFunctionsFactory.IsNamespaceEnvNodeGen::create);
        add(NamespaceFunctions.IsRegisteredNamespace.class, NamespaceFunctionsFactory.IsRegisteredNamespaceNodeGen::create);
        add(NamespaceFunctions.RegisterNamespace.class, NamespaceFunctionsFactory.RegisterNamespaceNodeGen::create);
        add(NamespaceFunctions.UnregisterNamespace.class, NamespaceFunctionsFactory.UnregisterNamespaceNodeGen::create);
        add(NormalizePath.class, NormalizePathNodeGen::create);
        add(OnExit.class, OnExitNodeGen::create);
        add(OptionsFunctions.Options.class, OptionsFunctionsFactory.OptionsNodeGen::create);
        add(Order.class, OrderNodeGen::create);
        add(PMatch.class, PMatchNodeGen::create);
        add(PMinMax.PMax.class, PMinMaxNodeGen.PMaxNodeGen::create);
        add(PMinMax.PMin.class, PMinMaxNodeGen.PMinNodeGen::create);
        add(Parse.class, ParseNodeGen::create);
        add(Paste.class, PasteNodeGen::create);
        add(Paste0.class, Paste0NodeGen::create);
        add(PathExpand.class, PathExpandNodeGen::create);
        add(Primitive.class, PrimitiveNodeGen::create);
        add(PrintFunctions.PrintDefault.class, PrintFunctionsFactory.PrintDefaultNodeGen::create);
        add(PrintFunctions.PrintFunction.class, PrintFunctionsFactory.PrintFunctionNodeGen::create);
        add(ProcTime.class, ProcTimeNodeGen::create);
        add(Prod.class, ProdNodeGen::create);
        add(Quit.class, QuitNodeGen::create);
        add(Quote.class, QuoteNodeGen::create);
        add(Range.class, RangeNodeGen::create);
        add(Rank.class, RankNodeGen::create);
        add(RNGFunctions.RNGkind.class, RNGFunctionsFactory.RNGkindNodeGen::create);
        add(RNGFunctions.SetSeed.class, RNGFunctionsFactory.SetSeedNodeGen::create);
        add(RVersion.class, RVersionNodeGen::create);
        add(RawFunctions.CharToRaw.class, RawFunctionsFactory.CharToRawNodeGen::create);
        add(RawFunctions.RawToChar.class, RawFunctionsFactory.RawToCharNodeGen::create);
        add(RawFunctions.RawShift.class, RawFunctionsFactory.RawShiftNodeGen::create);
        add(NumericalFunctions.Re.class, NumericalFunctionsFactory.ReNodeGen::create);
        add(ReadDCF.class, ReadDCFNodeGen::create);
        add(ReadREnviron.class, ReadREnvironNodeGen::create);
        add(Readline.class, ReadlineNodeGen::create);
        add(Recall.class, RecallNodeGen::create);
        add(RegFinalizer.class, RegFinalizerNodeGen::create);
        add(Repeat.class, RepeatNodeGen::create);
        add(RepeatInternal.class, RepeatInternalNodeGen::create);
        add(RepeatLength.class, RepeatLengthNodeGen::create);
        add(Return.class, ReturnNodeGen::create);
        add(Rhome.class, RhomeNodeGen::create);
        add(Rm.class, RmNodeGen::create);
        add(Round.class, RoundNodeGen::create);
        add(Row.class, RowNodeGen::create);
        add(RowMeans.class, RowMeansNodeGen::create);
        add(RowSums.class, RowSumsNodeGen::create);
        add(RowsumFunctions.Rowsum.class, RowsumFunctionsFactory.RowsumNodeGen::create);
        add(S3DispatchFunctions.NextMethod.class, S3DispatchFunctionsFactory.NextMethodNodeGen::create);
        add(S3DispatchFunctions.UseMethod.class, S3DispatchFunctionsFactory.UseMethodNodeGen::create);
        add(Sample.class, SampleNodeGen::create);
        add(Scan.class, ScanNodeGen::create);
        add(Seq.class, SeqNodeGen::create);
        add(SeqAlong.class, SeqAlongNodeGen::create);
        add(SeqLen.class, SeqLenNodeGen::create);
        add(SerializeFunctions.Serialize.class, SerializeFunctionsFactory.SerializeNodeGen::create);
        add(SerializeFunctions.SerializeB.class, SerializeFunctionsFactory.SerializeBNodeGen::create);
        add(SerializeFunctions.SerializeToConn.class, SerializeFunctionsFactory.SerializeToConnNodeGen::create);
        add(SerializeFunctions.Unserialize.class, SerializeFunctionsFactory.UnserializeNodeGen::create);
        add(SerializeFunctions.UnserializeFromConn.class, SerializeFunctionsFactory.UnserializeFromConnNodeGen::create);
        add(Setwd.class, SetwdNodeGen::create);
        add(ShortRowNames.class, ShortRowNamesNodeGen::create);
        add(NumericalFunctions.Sign.class, NumericalFunctionsFactory.SignNodeGen::create);
        add(Signif.class, SignifNodeGen::create);
        add(SinkFunctions.Sink.class, SinkFunctionsFactory.SinkNodeGen::create);
        add(SinkFunctions.SinkNumber.class, SinkFunctionsFactory.SinkNumberNodeGen::create);
        add(Slot.class, SlotNodeGen::create);
        add(SortFunctions.PartialSort.class, SortFunctionsFactory.PartialSortNodeGen::create);
        add(SortFunctions.QSort.class, SortFunctionsFactory.QSortNodeGen::create);
        add(SortFunctions.RadixSort.class, SortFunctionsFactory.RadixSortNodeGen::create);
        add(SortFunctions.Sort.class, SortFunctionsFactory.SortNodeGen::create);
        add(Split.class, SplitNodeGen::create);
        add(Sprintf.class, SprintfNodeGen::create);
        add(NumericalFunctions.Sqrt.class, NumericalFunctionsFactory.SqrtNodeGen::create);
        add(StandardGeneric.class, StandardGenericNodeGen::create);
        add(Stop.class, StopNodeGen::create);
        add(Strtoi.class, StrtoiNodeGen::create);
        add(Strtrim.class, StrtrimNodeGen::create);
        add(Substitute.class, SubstituteNodeGen::create);
        add(Substr.class, SubstrNodeGen::create);
        add(Sum.class, SumNodeGen::create);
        add(Switch.class, SwitchNodeGen::create);
        add(SysFunctions.SysChmod.class, SysFunctionsFactory.SysChmodNodeGen::create);
        add(SysFunctions.SysGetenv.class, SysFunctionsFactory.SysGetenvNodeGen::create);
        add(SysFunctions.SysGetpid.class, SysFunctionsFactory.SysGetpidNodeGen::create);
        add(SysFunctions.SysGlob.class, SysFunctionsFactory.SysGlobNodeGen::create);
        add(SysFunctions.SysInfo.class, SysFunctionsFactory.SysInfoNodeGen::create);
        add(SysFunctions.SysReadlink.class, SysFunctionsFactory.SysReadlinkNodeGen::create);
        add(SysFunctions.SysSetEnv.class, SysFunctionsFactory.SysSetEnvNodeGen::create);
        add(SysFunctions.SysSleep.class, SysFunctionsFactory.SysSleepNodeGen::create);
        add(SysFunctions.SysTime.class, SysFunctionsFactory.SysTimeNodeGen::create);
        add(SysFunctions.SysUmask.class, SysFunctionsFactory.SysUmaskNodeGen::create);
        add(SysFunctions.SysUnSetEnv.class, SysFunctionsFactory.SysUnSetEnvNodeGen::create);
        add(SystemFunction.class, SystemFunctionNodeGen::create);
        add(Tabulate.class, TabulateNodeGen::create);
        add(TempDir.class, TempDirNodeGen::create);
        add(TempFile.class, TempFileNodeGen::create);
        add(ToLowerOrUpper.ToLower.class, ToLowerOrUpper::createToLower);
        add(ToLowerOrUpper.ToUpper.class, ToLowerOrUpper::createToUpper);
        add(Traceback.class, TracebackNodeGen::create);
        add(TraceFunctions.PrimTrace.class, TraceFunctionsFactory.PrimTraceNodeGen::create);
        add(TraceFunctions.PrimUnTrace.class, TraceFunctionsFactory.PrimUnTraceNodeGen::create);
        add(TraceFunctions.TraceOnOff.class, TraceFunctionsFactory.TraceOnOffNodeGen::create);
        add(TraceFunctions.Tracemem.class, TraceFunctionsFactory.TracememNodeGen::create);
        add(TraceFunctions.Retracemem.class, TraceFunctionsFactory.RetracememNodeGen::create);
        add(TraceFunctions.Untracemem.class, TraceFunctionsFactory.UntracememNodeGen::create);
        add(Transpose.class, TransposeNodeGen::create);
        add(TrigExpFunctions.Acos.class, TrigExpFunctionsFactory.AcosNodeGen::create);
        add(TrigExpFunctions.Acosh.class, TrigExpFunctionsFactory.AcoshNodeGen::create);
        add(TrigExpFunctions.Asin.class, TrigExpFunctionsFactory.AsinNodeGen::create);
        add(TrigExpFunctions.Asinh.class, TrigExpFunctionsFactory.AsinhNodeGen::create);
        add(TrigExpFunctions.Atan.class, TrigExpFunctionsFactory.AtanNodeGen::create);
        add(TrigExpFunctions.Atan2.class, TrigExpFunctionsFactory.Atan2NodeGen::create);
        add(TrigExpFunctions.Atanh.class, TrigExpFunctionsFactory.AtanhNodeGen::create);
        add(TrigExpFunctions.Cos.class, TrigExpFunctionsFactory.CosNodeGen::create);
        add(TrigExpFunctions.Cosh.class, TrigExpFunctionsFactory.CoshNodeGen::create);
        add(TrigExpFunctions.Cospi.class, TrigExpFunctionsFactory.CospiNodeGen::create);
        add(TrigExpFunctions.Exp.class, TrigExpFunctionsFactory.ExpNodeGen::create);
        add(TrigExpFunctions.ExpM1.class, TrigExpFunctionsFactory.ExpM1NodeGen::create);
        add(TrigExpFunctions.Sin.class, TrigExpFunctionsFactory.SinNodeGen::create);
        add(TrigExpFunctions.Sinh.class, TrigExpFunctionsFactory.SinhNodeGen::create);
        add(TrigExpFunctions.Sinpi.class, TrigExpFunctionsFactory.SinpiNodeGen::create);
        add(TrigExpFunctions.Tan.class, TrigExpFunctionsFactory.TanNodeGen::create);
        add(TrigExpFunctions.Tanh.class, TrigExpFunctionsFactory.TanhNodeGen::create);
        add(TrigExpFunctions.Tanpi.class, TrigExpFunctionsFactory.TanpiNodeGen::create);
        add(Trunc.class, TruncNodeGen::create);
        add(Typeof.class, TypeofNodeGen::create);
        add(UnClass.class, UnClassNodeGen::create);
        add(Unique.class, UniqueNodeGen::create);
        add(Unlist.class, UnlistNodeGen::create);
        add(UpdateAttr.class, UpdateAttrNodeGen::create);
        add(UpdateAttributes.class, UpdateAttributesNodeGen::create);
        add(UpdateClass.class, UpdateClassNodeGen::create);
        add(UpdateDim.class, UpdateDimNodeGen::create);
        add(UpdateDimNames.class, UpdateDimNamesNodeGen::create);
        add(EnvFunctions.UpdateEnvironment.class, EnvFunctionsFactory.UpdateEnvironmentNodeGen::create);
        add(UpdateLength.class, UpdateLengthNodeGen::create);
        add(UpdateLevels.class, UpdateLevelsNodeGen::create);
        add(UpdateNames.class, UpdateNamesNodeGen::create);
        add(UpdateOldClass.class, UpdateOldClassNodeGen::create);
        add(UpdateSlot.class, UpdateSlotNodeGen::create);
        add(UpdateStorageMode.class, UpdateStorageModeNodeGen::create);
        add(UpdateSubstr.class, UpdateSubstrNodeGen::create);
        add(VApply.class, VApplyNodeGen::create);
        add(Vector.class, VectorNodeGen::create);
        add(Warning.class, WarningNodeGen::create);
        add(WhichFunctions.Which.class, WhichFunctionsFactory.WhichNodeGen::create);
        add(WhichFunctions.WhichMax.class, WhichFunctionsFactory.WhichMaxNodeGen::create);
        add(WhichFunctions.WhichMin.class, WhichFunctionsFactory.WhichMinNodeGen::create);
        add(Xtfrm.class, XtfrmNodeGen::create);
    }

    private static void addFastPath(MaterializedFrame baseFrame, String name, FastPathFactory factory) {
        RFunction function = ReadVariableNode.lookupFunction(name, baseFrame);
        ((RRootNode) function.getRootNode()).setFastPath(factory);
    }

    private static void addFastPath(MaterializedFrame baseFrame, String name, java.util.function.Supplier<RFastPathNode> factory, Class<?> builtinNodeClass) {
        RBuiltin builtin = builtinNodeClass.getAnnotation(RBuiltin.class);
        addFastPath(baseFrame, name, FastPathFactory.fromRBuiltin(builtin, factory));
    }

    @Override
    public void loadOverrides(MaterializedFrame baseFrame) {
        super.loadOverrides(baseFrame);
        addFastPath(baseFrame, "matrix", () -> MatrixFastPathNodeGen.create(null), Matrix.class);
        addFastPath(baseFrame, "setdiff", () -> SetDiffFastPathNodeGen.create(null));
        addFastPath(baseFrame, "get", () -> GetFastPathNodeGen.create(null));
        addFastPath(baseFrame, "exists", () -> ExistsFastPathNodeGen.create(null), Exists.class);
        addFastPath(baseFrame, "assign", () -> AssignFastPathNodeGen.create(null), Assign.class);
        addFastPath(baseFrame, "is.element", () -> IsElementFastPathNodeGen.create(null));
        addFastPath(baseFrame, "integer", () -> IntegerFastPathNodeGen.create(null));
        addFastPath(baseFrame, "numeric", () -> DoubleFastPathNodeGen.create(null));
        addFastPath(baseFrame, "double", () -> DoubleFastPathNodeGen.create(null));
        addFastPath(baseFrame, "intersect", () -> IntersectFastPathNodeGen.create(null));
        addFastPath(baseFrame, "pmax", FastPathFactory.EVALUATE_ARGS);
        addFastPath(baseFrame, "pmin", FastPathFactory.EVALUATE_ARGS);
        addFastPath(baseFrame, "cbind", FastPathFactory.FORCED_EAGER_ARGS);
        addFastPath(baseFrame, "rbind", FastPathFactory.FORCED_EAGER_ARGS);

        setContainsDispatch(baseFrame, "sys.function", "match.arg", "eval", "[.data.frame", "[[.data.frame", "[<-.data.frame", "[[<-.data.frame");
    }

    private static void setContainsDispatch(MaterializedFrame baseFrame, String... functions) {
        for (String name : functions) {
            RFunction function = ReadVariableNode.lookupFunction(name, baseFrame);
            ((RRootNode) function.getRootNode()).setContainsDispatch(true);
        }
    }
}
